﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;

namespace WjAutoConfigApp
{
    /// <summary>
    /// 车道属性模型
    /// </summary>
    [Serializable]
    public class LaneAllPropertyModel
    {
        /// <summary>
        /// 车道编号
        /// </summary>
        public string? LaneNum { get; set; }

        

        /// <summary>
        /// 方向
        /// </summary>
        public string? Direction { get; set; }

        /// <summary>
        /// 车道宽度
        /// </summary>
        public string? With { get; set; }

        /// <summary>
        /// 车道长度
        /// </summary>
        public string? Long { get; set; }

        /// <summary>
        /// 车道起始点X坐标
        /// </summary>
        public string? StartX { get; set; }

        /// <summary>
        /// 车道起始点Y坐标
        /// </summary>
        public string? StartY { get; set; }

        public string? EndX { get; set; }

        /// <summary>
        /// 结束坐标点Y坐标
        /// </summary>
        public string? EndY { get; set; }

        /// <summary>
        /// 是否非机动车道
        /// </summary>
        public string? IsUnMotor { get; set; }

        /// <summary>
        /// 是否专用车道
        /// </summary>
        public string? IsSpecial { get; set; }

        /// <summary>
        /// 是否应急车道
        /// </summary>
        public string? IsMeet { get; set; }

        /// <summary>
        /// 速度
        /// </summary>
        public string? Speed { get; set; }

        /// <summary>
        /// 重写ToString()方法
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            List<string> values = new List<string>();
            Type type = this.GetType();
            PropertyInfo[] propertyInfos = type.GetProperties();
            foreach (var property in propertyInfos)
            {
                var value = property.GetValue(this, null);
                if (value is null) value = string.Empty;
                values.Add(value.ToString());
            }
            return string.Join(";", values);
        }

    }
}
